package thread;

class MyThread4 extends Thread{
    @Override
    public void run() {
        System.out.println("ID: " + this.getId() + ", name: " + this.getName());
    }
}
public class ThreadDemo12 {
    public static void main(String[] args) {
        Thread t1 = new MyThread4();
        Thread t2 = new Thread(new Runnable() {
            @Override
            public void run() {
                Thread tmp = Thread.currentThread();
                System.out.println("ID: " + tmp.getId() + ", name: " + tmp.getName());
            }
        });
        Thread t3 = new Thread(() -> {
            Thread tmp = Thread.currentThread();
            System.out.println("ID: " + tmp.getId() + ", name: " + tmp.getName());
        });

        t1.start();
        t2.start();
        t3.start();
    }
}
